package com.dragon.modules.yuegou.query.merchant;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.merchant.MerchantLevelRuleDetailEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 等级规则-明细 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-09-23 15:29:06
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class MerchantLevelRuleDetailQuery extends MerchantLevelRuleDetailEntity implements Query<MerchantLevelRuleDetailEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 等级ID查询条件 */
	@JsonUnwrapped(prefix = "levelRuleId")
	private Condition<String> levelRuleIdCondition;

    /** 购买单价查询条件 */
	@JsonUnwrapped(prefix = "unitPrice")
	private Condition<BigDecimal> unitPriceCondition;

    /** 折扣价查询条件 */
	@JsonUnwrapped(prefix = "discountPrice")
	private Condition<BigDecimal> discountPriceCondition;

    /** 折扣有效期开始日期查询条件 */
	@JsonUnwrapped(prefix = "startTime")
	private Condition<LocalDateTime> startTimeCondition;

    /** 折扣有效期结束日期查询条件 */
	@JsonUnwrapped(prefix = "endTime")
	private Condition<LocalDateTime> endTimeCondition;

    /** 有效期限，单位：月查询条件 */
	@JsonUnwrapped(prefix = "periodValidity")
	private Condition<Integer> periodValidityCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public MerchantLevelRuleDetailQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public MerchantLevelRuleDetailQuery(MerchantLevelRuleDetailEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public MerchantLevelRuleDetailQuery(MerchantLevelRuleDetailQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.levelRuleIdCondition != null) {
			this.levelRuleIdCondition = other.levelRuleIdCondition.copy();
		}
		if(other.unitPriceCondition != null) {
			this.unitPriceCondition = other.unitPriceCondition.copy();
		}
		if(other.discountPriceCondition != null) {
			this.discountPriceCondition = other.discountPriceCondition.copy();
		}
		if(other.startTimeCondition != null) {
			this.startTimeCondition = other.startTimeCondition.copy();
		}
		if(other.endTimeCondition != null) {
			this.endTimeCondition = other.endTimeCondition.copy();
		}
		if(other.periodValidityCondition != null) {
			this.periodValidityCondition = other.periodValidityCondition.copy();
		}
	}

	@Override
	public QueryWrapper<MerchantLevelRuleDetailEntity> toQueryWrapper() {
		QueryWrapper<MerchantLevelRuleDetailEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (levelRuleIdCondition != null) {
			levelRuleIdCondition.toWrapper(wrapper, COL_LEVEL_RULE_ID);
		}
		if (unitPriceCondition != null) {
			unitPriceCondition.toWrapper(wrapper, COL_UNIT_PRICE);
		}
		if (discountPriceCondition != null) {
			discountPriceCondition.toWrapper(wrapper, COL_DISCOUNT_PRICE);
		}
		if (startTimeCondition != null) {
			startTimeCondition.toWrapper(wrapper, COL_START_TIME);
		}
		if (endTimeCondition != null) {
			endTimeCondition.toWrapper(wrapper, COL_END_TIME);
		}
		if (periodValidityCondition != null) {
			periodValidityCondition.toWrapper(wrapper, COL_PERIOD_VALIDITY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回等级ID查询条件
	 * 
	 * @return levelRuleIdCondition 等级ID查询条件
	 */
	public Condition<String> levelRuleId() {
		this.levelRuleIdCondition = new Condition<>();
		return this.levelRuleIdCondition;
	}
	
	/**
	 * 获取等级ID查询条件
	 * 
	 * @return levelRuleIdCondition 等级ID查询条件
	 */
	public Condition<String> getLevelRuleIdCondition() {
		return levelRuleIdCondition;
	}

	/**
	 * 设置等级ID查询条件
	 * 
	 * @param levelRuleIdCondition 等级ID查询条件
	 */
	public void setLevelRuleIdCondition(Condition<String> levelRuleIdCondition) {
		this.levelRuleIdCondition = levelRuleIdCondition;
	}

	/**
	 * 构造并返回购买单价查询条件
	 * 
	 * @return unitPriceCondition 购买单价查询条件
	 */
	public Condition<BigDecimal> unitPrice() {
		this.unitPriceCondition = new Condition<>();
		return this.unitPriceCondition;
	}
	
	/**
	 * 获取购买单价查询条件
	 * 
	 * @return unitPriceCondition 购买单价查询条件
	 */
	public Condition<BigDecimal> getUnitPriceCondition() {
		return unitPriceCondition;
	}

	/**
	 * 设置购买单价查询条件
	 * 
	 * @param unitPriceCondition 购买单价查询条件
	 */
	public void setUnitPriceCondition(Condition<BigDecimal> unitPriceCondition) {
		this.unitPriceCondition = unitPriceCondition;
	}

	/**
	 * 构造并返回折扣价查询条件
	 * 
	 * @return discountPriceCondition 折扣价查询条件
	 */
	public Condition<BigDecimal> discountPrice() {
		this.discountPriceCondition = new Condition<>();
		return this.discountPriceCondition;
	}
	
	/**
	 * 获取折扣价查询条件
	 * 
	 * @return discountPriceCondition 折扣价查询条件
	 */
	public Condition<BigDecimal> getDiscountPriceCondition() {
		return discountPriceCondition;
	}

	/**
	 * 设置折扣价查询条件
	 * 
	 * @param discountPriceCondition 折扣价查询条件
	 */
	public void setDiscountPriceCondition(Condition<BigDecimal> discountPriceCondition) {
		this.discountPriceCondition = discountPriceCondition;
	}

	/**
	 * 构造并返回折扣有效期开始日期查询条件
	 * 
	 * @return startTimeCondition 折扣有效期开始日期查询条件
	 */
	public Condition<LocalDateTime> startTime() {
		this.startTimeCondition = new Condition<>();
		return this.startTimeCondition;
	}
	
	/**
	 * 获取折扣有效期开始日期查询条件
	 * 
	 * @return startTimeCondition 折扣有效期开始日期查询条件
	 */
	public Condition<LocalDateTime> getStartTimeCondition() {
		return startTimeCondition;
	}

	/**
	 * 设置折扣有效期开始日期查询条件
	 * 
	 * @param startTimeCondition 折扣有效期开始日期查询条件
	 */
	public void setStartTimeCondition(Condition<LocalDateTime> startTimeCondition) {
		this.startTimeCondition = startTimeCondition;
	}

	/**
	 * 构造并返回折扣有效期结束日期查询条件
	 * 
	 * @return endTimeCondition 折扣有效期结束日期查询条件
	 */
	public Condition<LocalDateTime> endTime() {
		this.endTimeCondition = new Condition<>();
		return this.endTimeCondition;
	}
	
	/**
	 * 获取折扣有效期结束日期查询条件
	 * 
	 * @return endTimeCondition 折扣有效期结束日期查询条件
	 */
	public Condition<LocalDateTime> getEndTimeCondition() {
		return endTimeCondition;
	}

	/**
	 * 设置折扣有效期结束日期查询条件
	 * 
	 * @param endTimeCondition 折扣有效期结束日期查询条件
	 */
	public void setEndTimeCondition(Condition<LocalDateTime> endTimeCondition) {
		this.endTimeCondition = endTimeCondition;
	}

	/**
	 * 构造并返回有效期限，单位：月查询条件
	 * 
	 * @return periodValidityCondition 有效期限，单位：月查询条件
	 */
	public Condition<Integer> periodValidity() {
		this.periodValidityCondition = new Condition<>();
		return this.periodValidityCondition;
	}
	
	/**
	 * 获取有效期限，单位：月查询条件
	 * 
	 * @return periodValidityCondition 有效期限，单位：月查询条件
	 */
	public Condition<Integer> getPeriodValidityCondition() {
		return periodValidityCondition;
	}

	/**
	 * 设置有效期限，单位：月查询条件
	 * 
	 * @param periodValidityCondition 有效期限，单位：月查询条件
	 */
	public void setPeriodValidityCondition(Condition<Integer> periodValidityCondition) {
		this.periodValidityCondition = periodValidityCondition;
	}

}
